package inutan.game.event.model;

import inutan.common.context.FlowContext;
import inutan.game.business.GameFlowContext;
import org.ricks.common.event.IEvent;

public class RoleLevelUpEvent implements IEvent {
    private GameFlowContext context;
    private int lv;

    private int oldLv;

    public RoleLevelUpEvent(GameFlowContext context, int lv, int oldLv) {
        this.context = context;
        this.lv = lv;
        this.oldLv = oldLv;
    }

    public int getLv() {
        return lv;
    }

    public void setLv(int lv) {
        this.lv = lv;
    }

    public GameFlowContext getContext() {
        return context;
    }

    public void setContext(GameFlowContext context) {
        this.context = context;
    }

    public int getOldLv() {
        return oldLv;
    }

    public void setOldLv(int oldLv) {
        this.oldLv = oldLv;
    }

    /**
     * 重写分配线程ID ，否则事件机制会随机分配线程
     * @return
     */
    @Override
    public long threadId() {
        return context.getUserId();
    }
}
